Skip to content

Bless Component Trait - #3435

Open
hecrj wants to merge 26 commits into
masterfrom
bless-component
Open

Bless Component Trait#3435
hecrj wants to merge 26 commits into
masterfrom
bless-component

Conversation

@hecrj

@hecrj hecrj commented Aug 27, 2026

Copy link
Copy Markdown
Member

This PR simplifies the deprecated Component trait and widget implementation by removing self-references and other hacks.

As a result, the component widget is now undeprecated and can be officially leveraged again to create reusable widgets as embeddable iced apps.

The main API difference that allowed for these improvements is the new Component::view signature:

pub trait Component<'a, Message, Theme = crate::Theme, Renderer = crate::Renderer> {
    // ...
    fn view(&self, state: &Self::State) -> Element<'a, Self::Event, Theme, Renderer>;
}

The view of a Component can no longer borrow state from the component state itself, but just the application.

@hecrj hecrj added this to the 0.15 milestone Aug 27, 2026
@hecrj hecrj added improvement An internal improvement feature New feature or request widget change labels Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change feature New feature or request improvement An internal improvement widget

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant